<template>
	<view class="page">
		<view class="setting-box">
			<u-cell
				size="large"
				:border="false"
				title="加我好友时需要验证"
				:customStyle="{height:'50px',borderBottom:'0.1px solid #eee'}"
			>
				<template #value>
					<u-switch activeColor="#42b883" v-model="testSwitch" size="20"></u-switch>
				</template>
			</u-cell>
			<u-cell
				size="large"
				:border="false"
				title="允许别人搜索到我"
				:customStyle="{height:'50px',borderBottom:'0.1px solid #eee'}"
			>
				<template #value>
					<u-switch activeColor="#42b883" v-model="testSwitch" size="20"></u-switch>
				</template>
			</u-cell>
			<u-cell
				size="large"
				:border="false"
				title="消息提醒"
				:customStyle="{height:'50px',borderBottom:'0.1px solid #eee'}"
			>
				<template #value>
					<u-switch activeColor="#42b883" v-model="testSwitch" size="20"></u-switch>
				</template>
			</u-cell>
			<u-cell
				size="large"
				:border="false"
				title="关于GVIM"
				:isLink="true"
				value="1.0.1"
				:customStyle="{height:'50px',borderBottom:'0.1px solid #eee'}"
				@click="handleAbout"
			>
			</u-cell>
			<u-cell
				size="large"
				:border="false"
				title="反馈"
				:isLink="true"
				:customStyle="{height:'50px',borderBottom:'0.1px solid #eee'}"
				@click="handleFeedBack"
			>
			</u-cell>
		</view>
		<view class="setting-tool-logout-mg">
			<u-button class="setting-tool-logout" :hairline="false" text="退出登录" @click="handleLogout"></u-button>
		</view>
	</view>
	<u-modal
		:show="logoutShow"
		title="提醒"
		content='你确定要退出登录吗？'
		:showCancelButton="true"
		@confirm="handleLogoutOK"
		@cancel="handleExitLogout"
	></u-modal>
</template>

<script setup>
import {ref} from "vue"
import {removeToken} from "../../utils/auth.js"
let testSwitch = ref(true)
let logoutShow = ref(false)
function handleAbout() {
	uni.navigateTo({
		url:"/pagesD/setting/about/index"
	})
}
function handleFeedBack() {
	uni.navigateTo({
		url:"/pagesD/setting/feedback/index"
	})
}
function handleLogoutOK() {
	removeToken()
	uni.reLaunch({
		url:"/pagesE/login/index"
	})
}
function handleLogout(){
	logoutShow.value = true
}
function handleExitLogout() {
	logoutShow.value = false
}
</script>

<style>
	page {
		background-color: #eeeeee;
	}
</style>

<style lang="scss" scoped>
	.page{}
	.setting-box{
		margin-top: 30rpx;
		background-color: #ffffff;
	}
	.setting-tool-logout-mg{
		padding-top: 30rpx;
		background-color: #eeeeee;
	}
	.setting-tool-logout{
		height: 120rpx;
		font-size: 40rpx;
	}
</style>